package myjava.i_collection;

import java.util.HashSet;
import java.util.Set;

/**
 * @Auther: cty
 * @Date: 2019/11/15 下午10:12
 * @Description: 测试Set,无序不可重复
 * @version: 1.0
 */
public class J_TestHashSet {
    public static void main(String[] args){
        Set<String> set1 = new HashSet<>();

        set1.add("aa");
        set1.add("bb");
        set1.add("aa");
        System.out.println(set1);
        set1.remove("bb");
        System.out.println(set1);

        Set<String> set2 = new HashSet<>();
        set2.add("cty");
        set2.addAll(set1);
        System.out.println(set2);

    }
}
